<h1 class="heading"><?php echo $title; ?></h1>
<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>
<form id="form_midia" name="form_midia" action="<?php echo url_for('midia/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_midia='.$form->getObject()->getIdMidia() : '')) ?>" method="post" enctype="multipart/form-data" >
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="hastab" id="hastab" value="1" />
<input type="hidden" name="hasmodal" id="hasmodal" value="dialog" />

<?php if(!$form->getObject()->isNew()){ ?>
<input type="hidden" name="id_midia" value="<?php echo $form->getObject()->getIdMidia() ?>" />
<?php } else { ?>
<?php echo input_hidden_tag('ref_name', $ref_name); ?>
<?php echo input_hidden_tag('ref_value', $ref_value); ?>
<?php  }  ?>

<?php echo $form->renderHiddenFields() ?>
  <table class="form">
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['nm_midia']->renderLabel() ?></th>
        <td>
          <?php echo $form['nm_midia'] ?>
          <?php echo form_error('nm_midia'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_midia']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_midia'] ?>
          <?php echo form_error('ds_midia'); ?>
        </td>
      </tr>
    </tbody>
  </table>

<?php
	comandos_form(
		submit_tag(':: Salvar ::')
	);
?>
</form>

<script>
    $(function()
        {
            System.formdata.save(new Array("msgAtencao", "Atenção:"), true);
        }
    );
</script>